/*
const ws = new WebSocket("ws://localhost:8080")

ws.onopen( () => {
    console.log("onopen");
    console.log(arguments);
})

ws.onerror( () => {
    console.log("onerror");
    console.log(arguments);
})

ws.onclose( () => {
    console.log("onclose");
    console.log(arguments);
})

ws.onmessage( () => {
    console.log("onmessage");
    console.log(arguments);
})
*/

// Create WebSocket connection.
const socket = new WebSocket("ws://localhost:8080");

// Connection opened
socket.addEventListener("open", (event) => {
  socket.send("Hello Server!");
});

// Listen for messages
socket.addEventListener("message", (event) => {
  console.log("Message from server ==>", event.data);
});

